#
# Functions to handle information on records
#
package Counter::Recordinfo;


# Add admin fields - recdate and method - to a record
sub addadmin {
    my $record = shift;

    $record->{recdate} = scalar(gmtime);
    $record->{method} = "www";
    if (!defined($0)) {
	warn "addadmin: script undefined\n";
	$0 = "something";
    }
    if (!defined($ENV{REMOTE_ADDR})) {
	warn "addadmin: no REMOTE_ADDR\n";
	$ENV{REMOTE_ADDR} = "unknonwn";
    }
    if (!defined($ENV{REMOTE_USER})) {
	#warn "addadmin: no REMOTE_USER\n";
	$ENV{REMOTE_USER} = "";
    }
    $record->{ident} = "script=$0 ip=$ENV{REMOTE_ADDR} user=$ENV{REMOTE_USER}";
}
1;
